﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ecreate.Business;
using Ecreate.Model;
using System.Data;

namespace Ecreate.Web.pages
{
    public partial class ordercrud : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string id = Request.QueryString["id"];
                if (id != null && id != "")
                {
                    string sql = "select OrderID,KickOrderID,SN,Times,SellAddress,SellPhoneNumber,ProductName,Price,CustName,CustPhoneNumber,CustAddress,PayAccount,PayDate,IsCheckName"
                        + " from v_order where OrderID='" + id + "'";
                    DataTable dt = usercontrol.GG.GetTable(sql);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        DataRow dr = dt.Rows[0];
                        txtOrderID.Text = dr["OrderID"].ToString();
                        txtKickOrderID.Text = dr["KickOrderID"].ToString();
                        txtSN.Text = dr["SN"].ToString();
                        txtTimes.Text = dr["Times"].ToString();
                        txtProduct.Text = dr["ProductName"].ToString();
                        txtPrice.Text = dr["Price"].ToString();
                        txtSellAddress.Text = dr["SellAddress"].ToString();
                        txtSellPhoneNumber.Text = dr["SellPhoneNumber"].ToString();
                        txtCustName.Text = dr["CustName"].ToString();
                        txtCustPhoneNumber.Text = dr["CustPhoneNumber"].ToString();
                        txtCustAddress.Text = dr["CustAddress"].ToString();
                        txtPayDate.Text = dr["PayDate"].ToString();
                        txtPayAccount.Text = dr["PayAccount"].ToString();
                    }
                }
            }
        }
    }
}
